home *** CD-ROM | disk | FTP | other *** search
- #include <clib/exec_protos.h>
- #include <pragmas/exec_pragmas.h>
- #include <stdio.h>
- #include <strings.h>
- #include <clib/rtgextra_protos.h>
- #include <pragmas/rtgextra_pragmas.h>
- #include <rtgmaster/rtgtcpip.h>
- #include <clib/dos_protos.h>
-
- struct Library *SocketBase=0;
- struct Library *RTGExtraBase=0;
-
- void makeservaddr(struct sockaddr_in *address, char *host, int port);
- struct RTG_Socket *LIBOpenClient(char *host, struct Library *SBase, int port, int mode, int protocol);
- struct RTG_Socket rs;
-
- void main()
- {
- struct RTG_Socket *s;
- if (RTGExtraBase=OpenLibrary("rtgextra.library",0))
- {
- if (SocketBase=OpenLibrary("bsdsocket.library",4))
- {
- int i;
- long mode=1;
- char buf[1024];
- char buf2[1024];
- char *strings[]={"Nur","ein","Test",NULL};
- s=OpenClient(SocketBase,"194.55.101.26",3050,SOCK_STREAM,0);
- RtgIoctl(SocketBase,s,&mode);
- while(1)
- {
- if (RtgRecv(SocketBase,s,buf,0,25)>0)
- printf("%s\n",buf);
- sprintf(buf2,"Message from Socket ",s->s);
- RtgSend(SocketBase,s,buf2,0,strlen(buf2)+1);
- }
- CloseLibrary(SocketBase);
- CloseLibrary(RTGExtraBase);
- }
- }
- }
-
-